<? $page_title='采购需求汇总' ?>
<?include "FASHION/page_header.phtml"?>
<div id="printArea" class="horizontal">
<table class="ptop" border="0" cellpadding="4" cellspacing="0" width="100%">
         <thead>
            <tr class="nobg">
                <th><h2><?$print_com_name?></h2></th>
            </tr>
            <tr class="nobg">
                <th><h1><?$page_title?></h1></th>
            </tr>
        </thead>        
    </table>
<table border=0 class="list pcontent" width="100%">
    <thead>
	<tr>
	    <td colspan="17"><div class="left"><{$summary.demands}></div></td><td colspan="2"><div class="right"><?=date('Y年m月')?></div></td>
	</tr>
	<tr class="nobg">
		<th rowspan="2">编号</th>
		<th rowspan="2">材料名称</th>
		<th rowspan="2">品牌</th>
		<th rowspan="2">规格</th>
		<th rowspan="2">单位</th>
		<th colspan="3">补库采购</th>
		<th colspan="3">专项采购</th>
		<th colspan="3">紧急采购</th>
		<th colspan="3">小计</th>
		<th rowspan="2">部门</th>
		<th rowspan="2">备注</th>
	</tr>
	<tr class="nobg">
		<th>数量</th>
		<th>单价</th>
		<th>金额</th>
		<th>数量</th>
		<th>单价</th>
		<th>金额</th>
		<th>数量</th>
		<th>单价</th>
		<th>金额</th>
		<th>数量</th>
		<th>单价</th>
		<th>金额</th>
	</tr>
        </thead>
        <tbody>
<{if $summary.items}>
<?$bc=0;$bcm=0;$zc=0;$zcm=0;$jc=0;$jcm=0;$tc=0;$tcm=0;?>
<{foreach item=ware from=$summary.items}>
	<{foreach item=dept from=$ware.list}>
	<tr>
		<td><{$ware.sno}></td>
		<td style="width:80px"><{$ware.name}></td>
		<td><{$ware.brand}></td>
		<td style="width:80px"><{$ware.specific}></td>
		<td><{$ware.unit}></td>

		<td class="decimal"><{$dept.0.amount}></td>
<{if $dept.0.amount && floatval($ware.price) }>
		<td class="decimal fnum"><{$ware.price}></td>
		<td class="decimal fnum"><{= $ware.price*$dept.0.amount}></td>
                <?$bc += $dept.0.amount;$bcm += $ware.price*$dept.0.amount;?>
<{else}>
		<td></td>
		<td></td>
<{/if}>
		<td class="decimal"><{$dept.1.amount}></td>
<{if $dept.1.amount && floatval($ware.price) }>
		<td class="decimal fnum"><{$ware.price}></td>
		<td class="decimal fnum"><{= $ware.price*$dept.1.amount}></td>
                <?$zc += $dept.1.amount;$zcm += $ware.price*$dept.1.amount;?>
<{else}>
		<td></td>
		<td></td>
<{/if}>
		<td class="decimal"><{$dept.2.amount}></td>
<{if $dept.2.amount && floatval($ware.price) }>
		<td class="decimal fnum"><{$ware.price}></td>
		<td class="decimal fnum"><{= $ware.price*$dept.2.amount}></td>
                <?$jc += $dept.2.amount;$jcm += $ware.price*$dept.2.amount;?>
<{else}>
		<td></td>
		<td></td>
<{/if}>
		<td class="decimal"><{$ware.amount}></td>
		<td class="decimal fnum"><{$ware.price}></td>
		<td class="decimal fnum"><{$ware.total}></td>
                <?$tc += $ware.amount;$tcm += $ware.total;?>
		<td><{$dept.name}></td>
		<td><{$dept.remark}></td>
	</tr>
	<{/foreach}>
<{/foreach}>
<tr>
            <td colspan="5">合计：</td>
            <td class="decimal"><?$bc?></td>
            <td></td>
            <td class="decimal fnum"><?$bcm?></td>
            <td class="decimal"><?$zc?></td>
            <td></td>
            <td class="decimal fnum"><?$zcm?></td>
            <td class="decimal"><?$jc?></td>
            <td></td>
            <td class="decimal fnum"><?$jcm?></td>
            <td class="decimal"><?$tc?></td>
            <td></td>
            <td class="decimal fnum"><?$tcm?></td>
            <td></td>
            <td></td>
        </tr>
<{/if}>
</tbody>
</table>
</div>
<?include "FASHION/page_footer.phtml"?>
